package io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class OISDemo {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("./person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);

        Person p = (Person)ois.readObject();
        System.out.println(p);

        System.out.println(p.getName());

        ois.close();
    }
}
